<!--Jsm-->
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>成绩输入</title>
    <link rel="stylesheet" href="/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="/bootstrap/css/bootstrap-submenu.css">
    <link rel="stylesheet" href="/layui/css/layui.css">
    <!-- jq引用 -->
    <!--验证码引用  -->
    <!--<script type="text/javascript" src="js/sweetalert.min.js"></script>-->
    <!--<script type="text/javascript" src="js/publicSection.js"></script>-->
</head>
<body id="fontSize">
<!--头部引用  -->
<div class="container" id="frontTop"></div>

<div class="container" style="margin-top: 150px">
    <form id="fillceeForm" action="/v1/fillcee/selectFillingBatch" method="post" layui-form-pane>
        <div class="row">
            <div class="col-md-4">
                <h1>输入高考成绩</h1>
            </div>
        </div>
        <div class="container">
            <ul style="margin-top: 50px">

                <li>
                    <ul  class="list-inline row" >
                        <li class="offset-1 col-md-2">你的总分：</li>
                        <li class="col-md-4"><input name="Grade" id="Grade" class="col-md-12"  type="text"  /></li>

                    </ul>
                </li>
                <li>
                    <ul class="list-inline row" >
                        <li class="col-md-2 offset-1">你的科类：</li>
                        <li class="col-md-2 offset-	1">
                            <label class="radio-inline">
                                <input type="radio" name="inlineRadioOptions" id="inlineRadio1" value="option1" onchange="displayRank1()"> 理科
                            </label>
                        </li>
                        <li class="col-md-2 ">
                            <label class="radio-inline">
                                <input type="radio" name="inlineRadioOptions" id="inlineRadio2" value="option2" onchange="displayRank1()"> 文科
                            </label>
                        </li>
                    </ul>
                </li>
                <li>
                <ul class="list-inline row " style="margin-top: 50px">
                    <li class="col-md-2 offset-1">你的位次：</li>
                    <li class="col-md-4"><input class="col-md-12" id="displayRank" value="（输入分数默认显示位次）" disabled></li>
                    <li ><input style="display: none" name="kelei" id="kelei"></li>
                </ul>
            </li>
                <li >
                    <!--<input  id="submit" value="下一步" class="btn btn-primary col-md-2 offset-4" style="margin-top: 80px">-->
                    <a class="btn btn-primary col-md-2 offset-4" style="margin-top: 40px"  lay-filter="submit" lay-submit="" id="submit">下一步</a>
                </li>


            </ul>
        </div>
    </form>
</div>

<!--底部信息  -->

<div class="container" id="frontBottom"></div>
</body>

<script src="/js/jquery-3.3.0.js"></script>
<script src="/layui/layui.js"></script>
<script src="/js/core.util.js"></script>
<script src="/bootstrap/bootstrap.min.js"></script>
<script>

    $("#frontTop").load("/index/frontTop");
    $("#frontBottom").load("/index/frontBottom");

    //判断选择的是文理科
    var subject = 0;
    var grade = 0;
    dataJson={
        category:subject,
        score:grade,
    };
    function displayRank1() {
        //存储科类
        var storage = window.sessionStorage;
        // var y=document.getElementById("Grade").value;
        //根据文理科选择相应数据库
        if($("#inlineRadio1").prop("checked"))
        {
            document.getElementById("kelei").value = "理科";
            subject = 0;
            storage.setItem("subject", "理科")
        }
        else if($("#inlineRadio2").prop("checked"))
        {
            document.getElementById("kelei").value = "文科";
            subject = 1;
            storage.setItem("subject", "文科")
        }

        if(document.getElementById("Grade").value==""){
            alert("请填写你的分数");
            return false;
        }
        else{
            grade = document.getElementById("Grade").value;
            storage.setItem("grade",grade);
            dataJson={
                category:subject,
                score:grade,
            };
            layui.use(['jquery', 'form'], function () {
                CoreUtil.sendAjax("/v1/fillcee/getGrade", JSON.stringify(dataJson), function(res) {
                    document.getElementById("displayRank").value=res.data;
                },"POST",false);
            });

        }
    }

    layui.use(['jquery', 'form'], function () {
        var form = layui.form;
        form.on('submit', function(data) {
            // alert(dataJson)
            // jsm
            // 第一次跳转用ajax实现为了验证用户是否登录，不会跳转页面
            CoreUtil.sendAjax("/v1/fillcee/selectFillingBatch", JSON.stringify(dataJson), function(res) {
                // 第二次跳转，跳转到实际页面
                window.location.href="/navigation/selectFillingBatch"
            },"POST",false);
            return false;
        });

    });

</script>
</html>